<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@ page language="java" %>
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<meta HTTP-EQUIV="EXPIRES" CONTENT="0">
<meta HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
   
   <script>
      $(document).ready(function() {
         $('.listingTbl tr:even').addClass("evenRow");
         $('.listingTbl tr:odd').addClass("oddRow");
         if (Form.companyId.value != '')
            top.document.title = 'Saahas WMS | Edit Company Details';
         else
            top.document.title = 'Saahas WMS | Add Company Details';
      })
      
      // Saves the company details
      function save()
      {
         fnForward('company.shs', 'saveCompany');
      }
   </script>
</head>
<body class="textInputNormal_12">

   <form name="companyForm" method="post">
      <input type="hidden" name="impl"/>
      <input type="hidden" name="companyId" value="${companyForm.companyId}"/>
      <script>
         var pgName = "custCtr";
         var Form = document.companyForm;
      </script>
      
      <input type="button" class="bttn" value=" Save " onclick="save()"/>
      <input type="button" class="bttn" value=" Cancel " onclick="history.go(-1)"/>
      <br/><br/>
      <c:if test="${company.message != null}">
         <c:choose>
            <c:when test="${company.message == 'success'}">
               <div class="successDiv" style="margin-top: 5px;">
                  Task successfully completed.
               </div>
            </c:when>
            <c:otherwise>
               <div class="errDiv" style="margin-top: 5px;">
                  Task failed!
               </div>
            </c:otherwise>
         </c:choose>
      </c:if>
      
      <div style="margin-top: 10px; height: 450px; overflow: auto; width: 46%">
         <table width="97%" class="listingTbl">
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Company Name</span>
               </td>
               <td>
                  <c:set var="tempCompanyName" />
                  <c:choose>
                     <c:when test="${companyForm.companyName == null}">
                        <c:set var="tempCompanyName" value="${company.companyName}"/>
                     </c:when>
                     <c:otherwise>
                        <c:set var="tempCompanyName" value="${companyForm.companyName}"/>
                     </c:otherwise>
                  </c:choose>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${tempCompanyName}" name="companyName"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Address Line 1</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.address1}" name="address1"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Address Line 2</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.address2}" name="address2"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Address Line 3</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.address3}" name="address3"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">City</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.city}" name="city"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">State</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.state}" name="state"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Postal Code</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.postalCode}" name="postalCode"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Company Phone</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.companyPhone}" name="companyPhone"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Contact Name</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.contactName}" name="contactName"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Contact Phone</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.contactPhone}" name="contactPhone"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Contact Mobile</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.contactMobile}" name="contactMobile"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Contact E-mail</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.contactEMail}" name="contactEMail"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Monthly Fees</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.monthlyFees}" name="monthlyFees"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Labour Cost</span>
               </td>
               <td>
                  <input type="text" class="textInputNormal_12" size="30" 
                     value="${company.labourCost}" name="labourCost"/>
               </td>
            </tr>
            <tr>
               <td width="40%">
                  <span class="textSmallCaps">Comments</span>
               </td>
               <td>
                  <textarea name="comments" rows="4" cols="35" class="textInputNormal_12">${company.comments}</textarea>
               </td>
            </tr>
         </table>
      </div>
   </form>

</body>
</html>